package com.study.ksugb.sample.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.study.ksugb.sample.service.SampleService;


@Controller
@RequestMapping("/sample")
public class SampleController {

	@Autowired
	private SampleService sampleService;

	/**
	 * Test API
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/dbTest")
	public ModelAndView getDbTest(String myName) throws Exception {

		ModelAndView mv = new ModelAndView();

		String response = sampleService.getDbTest(myName);

		mv.addObject("response", response);
		return mv;

	}


}